package com.hmy.finance.client.contract;


import com.hmy.ccp.common.result.FeignResult;
import com.hmy.ccp.common.result.Results;
import com.hmy.ccp.error.annotations.HmyFeignController;
import com.hmy.finance.api.bo.core.request.FinancialContractUpdateApiRequest;
import com.hmy.finance.service.statement.IReconciliationStatementService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Validated
@RestController
@HmyFeignController
public class FinancialContractFeignClient {

    @Resource
    private IReconciliationStatementService reconciliationStatementService;

    /**
     * 更新账单确认单信息
     */
    @PutMapping("/feign/finance/statement/updateStatementConfirmContractInfo")
    public FeignResult<Boolean> updateStatementContractConfirmInfo(@RequestBody FinancialContractUpdateApiRequest financialContractUpdateApiRequest) {
        Boolean flag = reconciliationStatementService.updateContractSignedInfos(financialContractUpdateApiRequest);
        return Results.newSuccessResult(flag);
    }

    @PutMapping("/feign/finance/statement/updateStatementCreateContractInfo")
    FeignResult<Boolean> updateStatementContractCreateInfo(@RequestBody FinancialContractUpdateApiRequest financialContractUpdateApiRequest) {
        Boolean flag = reconciliationStatementService.updateContractCreateInfos(financialContractUpdateApiRequest);
        return Results.newSuccessResult(flag);
    }

}
